package wlt.model.rbac;

import org.casbin.jcasbin.main.Enforcer;
import wlt.domain.Request;
import wlt.util.EnforcerUtil;

/**
 * @author wuliting
 * @date 2021/11/5
 * RBAC + 资源组的访问控制案例
**/
public class RBACWithResourceGroup {
    public static void main(String[] args) {
        Enforcer enforcer = EnforcerUtil.createEnforcer("/rbac_resourceGroup/model.conf", "/rbac_resourceGroup/policy.csv");

        System.out.println(new Request("alice","data1","write2").isAllowed(enforcer));
    }
}
